package com.news.service.impl;

import com.news.mapper.CategoryMapper;
import com.news.model.Category;
import com.news.model.CategoryExample;
import com.news.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CategoryServiceImpl implements CategoryService{
    @Autowired
    CategoryMapper categoryMapper;
    @Override
    public List<Category> query() {
        CategoryExample categoryExample = new CategoryExample();
        categoryExample.setDistinct(true);
        categoryExample.or().andStutsEqualTo("1");
        return categoryMapper.selectByExample(categoryExample);
    }
}
